#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#if 0
int find(int arr[][3],int x,int y,int key)
{
	int i = 0;
	int j = y - 1;
	while (i < x && j >= 0)
	{
		if (arr[i][j] < key)
		{
			i++;
		}
		else if (arr[i][j] > key)
		{
			j--;
		}
		else
		{
			return 1;
		}
	}
	return 0;
}
int main()
{
	int arr[][3] = { {1,2,3} ,{4,5,6}, {7,8,9} };
	int zhi=find(arr, 3, 3, 5);
	if (zhi == 1)
	{
		printf("yes\n");
	}
	else
	{
		printf("no\n");
	}
	return 0;
}

void func()
{
	for (char killer = 'a'; killer <= 'd'; killer++)
	{
		if ((killer != 'a') + (killer == 'c') + (killer == 'd') + (killer != 'd')==3)
		{
			printf("killer is %c", killer);
		}
	}
}
int main()
{
	func();
	return 0;
}
#endif
void yang (int arr[][4],int n)
{
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (i == j || j == 0)
			{
				arr[i][j] = 1;
			}
			else
			{
				arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
			}

		}
	}
}
void pint(int arr[][4], int n)
{
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			printf("%d", arr[i][j]);
		}
		printf("\n");
	}
}
int main()
{
	int arr[4][4] = { 0 };
	int hang = 4;
	yang(arr, hang);
	pint(arr, hang);
	return 0;
}